package com.example;

import com.example.controller.UserController;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
// 此处是加上扫描的包问题,不加就是默认扫描本地的文件
@ComponentScan({"com.example.*"})
// 这里是对mybatis的文件进行扫描,不加这个,在自动注入DAO的时候会报错
@MapperScan(value = {"com.example.dao, com.resources.Mapper.*"})
// 缓存机制的注解
@EnableCaching
@ServletComponentScan
public class UserApplication {
    private static Logger logger = LoggerFactory.getLogger(UserController.class);

    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
        logger.info("----------------------info--------------------");
        logger.debug("---------------------debug---------------------");
        logger.error("---------------------error---------------------");
    }

}
